import {
  BooksShow,
  BooksUpload,
  News,
  BooksCollect,
  BooksAdmin,
  Dashboard,
  NewsAdmin,
  NewsEdit,
  NewsPublish,
  BooksBorrow,
  MyBooks
} from './pages'

const routes = [
  {
    path: '/admin/dashboard',
    component: Dashboard,
    title: '数据统计',
    role: ['admin', 'user'],
    isNav: true,
    iconType: 'dashboard',
    category: 'show'
  },
  {
    path: '/admin/booksshow',
    component: BooksShow,
    title: '书籍展示',
    role: ['admin', 'user'],
    isNav: true,
    iconType: 'book',
    category: 'show'
  },
  {
    path: '/admin/booksupload',
    component: BooksUpload,
    title: '书籍上传',
    role: ['admin', 'user'],
    isNav: true,
    iconType: 'upload',
    category: 'user'
  },
  {
    path: '/admin/news',
    component: News,
    title: '消息查看',
    role: ['admin', 'user'],
    isNav: true,
    iconType: 'sound',
    category: 'show'
  },
  {
    path: '/admin/bookscollect',
    component: BooksCollect,
    title: '书籍收藏',
    role: ['admin', 'user'],
    isNav: true,
    iconType: 'file',
    category: 'user'
  },
  {
    path: '/admin/booksborrow',
    component: BooksBorrow,
    title: '我的借阅',
    role: ['admin', 'user'],
    isNav: true,
    iconType: 'file-text',
    category: 'user'
  },
  {
    path: '/admin/mybooks',
    component: MyBooks,
    title: '我的书籍',
    role: ['admin', 'user'],
    isNav: true,
    iconType: 'file-markdown',
    category: 'user'
  },
  {
    path: '/admin/booksadmin',
    component: BooksAdmin,
    title: '书籍管理',
    role: 'admin',
    isNav: true,
    iconType: 'exception',
    category: 'admin'
  },
  {
    path: '/admin/newsadmin',
    component: NewsAdmin,
    title: '消息管理',
    role: 'admin',
    isNav: true,
    iconType: 'profile',
    category: 'admin'
  },
  //消息编辑
  {
    path: '/admin/newsadmin/newsedit/:id',
    component: NewsEdit,
    role: 'admin',
    isNav: false
  },
  //消息发布
  {
    path: '/admin/newsadmin/newspublish',
    component: NewsPublish,
    role: 'admin',
    isNav: false
  }
]

export default routes
